package com.xm.service.background;

import lombok.SneakyThrows;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 根据Id删除商品参数
 * @author 康文程
 * @date 2024-1-20 上午 10:44
 */
@WebServlet("/background/delete/commodity/parameter/by/id")
public class DeleteCommodityParameterByIdServlet extends HttpServlet {
    private final CommodityParameterService service = new CommodityParameterService();
    @SneakyThrows
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String parameterId = req.getParameter("parameterId");
        resp.getWriter().print(service.deleteById(Integer.parseInt(parameterId)));
    }
}
